<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>变量</title>
</head>
<body>
    

    <script>
        // var 1- 可以重复声明；  2-无法限制修改    3-没有块级作用域
        // let const  不能重复声明；

        /* let a = 10;
        
        var a = 100;

        console.log(a); // Identifier 'a' has already been declared */


        function Fn (name,pass) {
            this.name = name;
            this.pass = pass;
        }

        Fn.prototype = {
            showName(){
                alert(this.name);
            },
            showPass(){
                alert(this.pass);
            }
        };

        let u = new Fn("ws","123456");

        console.log(Fn.prototype);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              
        
    </script>
</body>
</html>